<?php 
echo '<?xml version="1.0" encoding="{', L_ENCODING, '}" ?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo L_LANG; ?>" lang="<?php echo L_LANG; ?>">
  <head>
    <title><?php echo $tpl['page_title']; ?></title>
    <link rel="stylesheet" type="text/css" href="filefind.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo L_ENCODING; ?>" />
    <link rel="search" href="open_search.php" title="FileFind" type="application/opensearchdescription+xml">
    <?php echo $tpl['rel']; 
if (false !== $tpl['input_form_highlite']) {
?>
<script type="text/javascript"><!--
// Выделить выбранный элементы формы (c) 2006 Rage Steel
// А если ввести кэш для сохранения полученных getElementById элементов, 
// то в MSIE должно пошустрей зашуршать (статья на design.ru).
function form_highlite(element) {
  var form = element.form;
  var el;
  var el_span;

  for (var i = 0; i < form.elements.length; i++) {
    el = form.elements[i];

    if (('radio' == el.type) || ('checkbox' == el.type)) {
      el_span = document.getElementById('s_' + el.id);
      if (el_span) {
        el_span.className = el.checked ? 'selected' : '';
//      } else {
//        alert('Not found: ' + 's_' + el.id);
      }
    }
  }
} // form_highlite
// --></script>
<?php
}
?>
  </head>
  <body<?php
$onload = '';
if (isset($tpl['search_box'])) {
  $onload .= 'sf();';
}
if (false !== $tpl['input_form_highlite']) {
  $onload .= 'form_highlite(document.getElementById(' . $tpl['input_form_highlite'] . '));';
}
if ('' != $onload) {
  echo ' onload="', $onload, '"';
}

?>>
<?php
if (isset($tpl['is_main_page'])) {
?>
    <div style="text-align: center;"><img src="img/ff_big.png" width="398" height="193" 
  alt="FileFind" /></div>
<?php
} else {
?>
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="page_foot">
 <tr>
  <td style="width: 133px"><a href="<?php echo $lnk['home']; ?>"><img src="img/ff_small.png" border="0" width="133" height="74" alt="FileFind" /></a></td>
  <td style="background: repeat-x url(img/top_line.png);"><h1><?php  echo $tpl['page_title']; ?></h1></td>
 </tr>
</table>
<?php
}
if (isset($tpl['search_box'])) {
  echo $tpl['search_box'];
}

if (isset($tpl['error'])) {
  echo '<p class="error">', $tpl['error'] . '</p>';
}
echo $tpl['page_body'];

if (!isset($tpl['is_main_page'])) {
?>
<div style="text-align: right;"><a href="<?php echo $lnk['home']; ?>"><?php echo L_RETURN_MAIN; ?></a></div>
<?php
}
?>
    <table border="0" cellspacing="0" cellpadding="0" width="100%" class="page_foot">
      <tr>
       <td style="width: 147px"><img src="img/bottom_left.png" width="147" height="147" alt=" " /></td>
       <td align="center" style="background: repeat-x url(img/bottom_line.png);">
         <a href="<?php echo $lnk['contact']; ?>"><?php echo L_CONTACT; ?></a>
         <br /><br /><a href="http://project.ffind.ru/">FileFind</a> v<?php echo $tpl['version']; ?> &copy; 
  2003&ndash;2008 <strong>Rage Steel</strong>, 
         design &copy; 2005 <strong>Joy</strong> &amp; 2005-2006 <strong>Mat1sha</strong>.
         <br /><br /><?php printf(L_PAGE_GEN_TIME, $tpl['pgt']); 
  if ($tpl['qrt'] > 0) { printf(L_PAGE_QUERIES_TIME, $tpl['qrt'], $tpl['qrc']); } ?>
       </td>
       <td style="width: 147px"><img src="img/bottom_right.png" width="147" height="147" alt=" " /></td>
      </tr>
    </table>
  </body>
</html>
